<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>添加/编辑地区 - Powered By ${systemConfig.systemName}</title>
<meta name="Author" content="E-SHOP Team" />
<meta name="Copyright" content="E-SHOP" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<% include("/WEB-INF/views/common/include.html"){}%>
<link href="${base}/res/css/input.css" rel="stylesheet" type="text/css" />
<%
var isAdd = false;
var isEdit = false;
if(isEmpty(area.id)){
	isAdd = true;
}else{
	isEdit = true;
}%>
</head>
<body class="input">
	<div class="body">
		<div class="inputBar">
			<h1><span class="icon">&nbsp;</span><%if(isAdd){%>添加地区<%}else{%>编辑地区<%}%></h1>
		</div>
		<form id="inputForm" class="validate" action="<%if (isAdd){%>${base}/area/save<%}else{%>${base}/area/update<%}%>" method="post">
			<input type="hidden" name="area.id" value="${area.id!}" />
			<input type="hidden" name="area.parent_id" value="${parent.id!}" />
			<table class="inputTable">
				<tr>
					<th>
						上级地区:
					</th>
					<td>
						<%if(isEmpty(parent.id)){%>一级地区<%}else{%>${parent.name!}<%}%>
					</td>
				</tr>
				<tr>
					<th>
						地区名称:
					</th>
					<td>
						<input type="text" name="area.name" class="formText {required: true, remote: '${base}/area/checkName?${area.name!}&parentId=${parent.id!}', messages: {remote: '此地区名称已存在!'}}" value="${area.name!}" />
						<label class="requireField">*</label>
					</td>
				</tr>
			</table>
			<div class="buttonArea">
				<input type="submit" class="formButton" value="确  定" hidefocus="true" />&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" class="formButton" onclick="window.history.back(); return false;" value="返  回" hidefocus="true" />
			</div>
		</form>
	</div>
</body>
</html>